package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.CommentDAO;
import cn.nebula.music.domain.Comment;

@Component
public class StringToCommentConverter implements Converter<String,Comment>{

	
	@Autowired
	private CommentDAO commentDAO;

	@Override
	public Comment convert(String source) {
		return commentDAO.findCommentById(Integer.valueOf(source));
	}
	
}
